Unit overhaul 1/6: Add unit-conversion utilities and FitTarget#221
Open
henrikjacobsenfys wants to merge 3 commits into
Open
Unit overhaul 1/6: Add unit-conversion utilities and FitTarget#221henrikjacobsenfys wants to merge 3 commits into
henrikjacobsenfys wants to merge 3 commits into
Conversation
Additive foundation for the unit-system overhaul, split out of the larger branch so it can be reviewed and merged on its own. - utils.py: add convert_value_unit, convert_parameter_unit, convert_units_with_rollback, energy_to_scipp, verify_Q_index and _assert_valid_unit helpers, plus the kb constant and CANONICAL_Q_UNIT. No behavior change to existing functions. - fit_target.py: new FitTarget dataclass describing one fittable model prediction bound to a dataset key. - test_utils.py: tests for the new helper functions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #221 +/- ##
===========================================
+ Coverage 97.89% 97.92% +0.03%
===========================================
Files 52 53 +1
Lines 3653 3707 +54
Branches 650 660 +10
===========================================
+ Hits 3576 3630 +54
Misses 45 45
Partials 32 32
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This was referenced Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Additive foundation for the unit-system overhaul, split out of the larger branch so it can be reviewed and merged on its own.
convert_value_unit,convert_parameter_unit,convert_units_with_rollback,energy_to_scipp,verify_Q_indexand_assert_valid_unithelpers, plus thekbconstant andCANONICAL_Q_UNIT. No behavior change to existing functions.FitTargetdataclass describing one fittable model prediction bound to a dataset key.All unit tests pass.
Stack — splitting the monolithic "Unit system overhaul" (#217) into a reviewable series. Merge bottom-up:
develop(Unit overhaul 1/6: Add unit-conversion utilities and FitTarget #221) (this PR)verify_Q_index→split/01-unit-utils(Unit overhaul 2/6: Centralize Q-index validation via verify_Q_index #222)Variablein 1/angstrom →split/02a-verify-q-index(Unit overhaul 3/6: Store Q as a scipp Variable in 1/angstrom #223)unitintox_unit/y_unit+ update tutorials →split/02b-q-variable(Unit overhaul 4/6: Separate unit into x_unit/y_unit and update tutorials #224)🤖 Generated with Claude Code